<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:ice="http://www.icesoft.com/icefaces/component">
<head>
<link rel="stylesheet" type="text/css" href="../woodstock/woodstock.css" />
</head>
<body>
<f:view>
	<ice:form>
		<ice:panelPopup modal="true" visible="#{userPostsMBean.windowVisible}"
			autoCentre="true">
			<f:facet name="header">
				<ice:panelGrid columns="2" width="100%"
					columnClasses="floatLeft,floatRight" styleClass="#{configMBean.style}">
					<ice:outputText value="Lista de posts" />
					<ice:commandButton value="x"
						actionListener="#{userPostsMBean.fecharWindow}" />
				</ice:panelGrid>
			</f:facet>
			<f:facet name="body">
				<ice:panelGrid width="100%">
					<ice:panelGrid border="1" columns="1" width="100%"
						style="text-align:center;">
						<ice:panelGrid columns="2">
							<ice:commandButton image="./woodstock/css-images/button/back.gif"
								actionListener="#{userPostsMBean.toBack}"
								disabled="#{userPostsMBean.anterior}" />
							<ice:commandButton
								image="./woodstock/css-images/button/front.gif"
								actionListener="#{userPostsMBean.toFront}"
								disabled="#{userPostsMBean.proximo}" />
						</ice:panelGrid>
					</ice:panelGrid>
					<ice:panelGrid columns="1" width="100%" style="width: 500px; ">
						<ui:repeat value="#{userPostsMBean.posts}" var="post">
							<ice:panelCollapsible styleClass="#{configMBean.panelStyle}">
								<f:facet name="header">
									<ice:panelGroup>
										<ice:panelGrid>
											<ice:outputText value="#{post.assunto}" />
											<ui:repeat value="#{post.tags}" var="tag">
												<ice:commandLink>
													<ice:outputText value="#{tag}" />
												</ice:commandLink>
											</ui:repeat>
										</ice:panelGrid>
									</ice:panelGroup>
								</f:facet>
								<ice:panelGroup style="border-bottom: 3px dashed gray; ">
									<br />
									<br />
									<ice:outputText value="#{post.mensagem}" />
									<br />
								</ice:panelGroup>
								<ice:panelGroup style="text-align:right;">
									<ice:panelGrid columns="1">
										<ice:commandButton
											image="./woodstock/css-images/button/del.png"
											actionListener="#{userPostsMBean.excluirPost}">
											<f:attribute value="#{post.id}" name="postId" />
										</ice:commandButton>
									</ice:panelGrid>
								</ice:panelGroup>
								<ui:repeat value="#{post.comentarios}" var="com">
									<ice:panelGrid columns="1" width="100%"
										style="border: 1px gray solid;">
										<ice:outputText value="#{com.conteudo}" />
										<ice:panelGrid columns="3" width="100%">
											<ice:outputText value="#{com.data}" />
											<ice:outputText value="#{com.autor}" />
										</ice:panelGrid>
									</ice:panelGrid>
								</ui:repeat>
							</ice:panelCollapsible>
						</ui:repeat>
					</ice:panelGrid>
					<ice:panelGroup style="text-align:right;">
						<ice:commandButton value="Cancelar"
							actionListener="#{userPostsMBean.fecharWindow}" />
					</ice:panelGroup>
				</ice:panelGrid>
			</f:facet>
		</ice:panelPopup>
	</ice:form>
</f:view>
</body>
</html>